import { type ComponentConfigModel } from 'epic-designer';

export default {
  component: () => import('./text'),
  groupName: '表单',
  icon: 'icon--epic--123-rounded',
  defaultSchema: {
    label: '文本',
    type: 'text',
    field: 'text',
    input: false,
  },
  config: {
    attribute: [
      {
        label: '字段名',
        type: 'input',
        field: 'field',
      },
      {
        label: '标题',
        type: 'input',
        field: 'label',
      },
      {
        label: '类型',
        type: 'select',
        componentProps: {
          placeholder: '请选择',
          clearable: true,
          options: [
            {
              label: 'primary',
              value: 'primary',
            },
            {
              label: 'success',
              value: 'success',
            },
            {
              label: 'info',
              value: 'info',
            },
            {
              label: 'warning',
              value: 'warning',
            },
            {
              label: 'danger',
              value: 'danger',
            },
          ],
        },
        field: 'componentProps.type',
      },
      {
        label: '显示省略号',
        type: 'switch',
        field: 'componentProps.truncated',
      },
    ],
  },
} as ComponentConfigModel;
